//
//  BMSBasePopupView.m
//  WDBMS
//
//  Created by YeJary on 2025/5/12.
//

#import "BMSBasePopupView.h"

@interface BMSBasePopupView()


@end


@implementation BMSBasePopupView

- (void)executeWithClickLock:(NSTimeInterval)interval action:(dispatch_block_t)action {
    if (self.isClickLocked) return;

    self.isClickLocked = YES;
    if (action) action();

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(interval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        self.isClickLocked = NO;
    });
}

- (void)didMoveToSuperview {
    [super didMoveToSuperview];
    NSLog(@"[BMS] Popup attached: %@", self);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
